package com.shop.user.controller.role;

import com.modular.result.PageResult;
import com.modular.result.RspMessage;
import com.shop.user.service.role.IRoleService;
import com.shop.user.utils.PageUtils;
import com.shop.user.vo.role.RolePageReqVo;
import com.shop.user.vo.role.RolePageResVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/b/role")
@Api(tags = "角色模块")
public class RoleController {
    @Autowired
    private IRoleService roleService;
    /**
     * 查询分页
     * @param reqVo
     * @return
     */
    @ApiOperation("查询用户列表")
    @PostMapping("findPage")
    public RspMessage<PageResult<RolePageResVo>> findPage(@RequestBody RolePageReqVo reqVo){
        return RspMessage.success(PageUtils.cover(roleService.findPage(reqVo)));
    }
}
